package org.brisling.oa;

import java.util.List;

import org.brisling.oa.domain.OACarApply;
import org.brisling.oa.domain.OADrugPurchase;
import org.brisling.oa.queryService.QueryOACarApplyService;
import org.brisling.oa.queryService.QueryOADrugPurchaseService;
import org.brisling.oa.service.OACarApplyService;
import org.brisling.oa.service.OADrugPurchaseService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

public class testDelRubbish {

	@Autowired
	private QueryOADrugPurchaseService qryDrugPurchaseService;
	@Autowired
	private OADrugPurchaseService drugPurchaseService;
	@Autowired
	private OACarApplyService carApplySer;
	@Autowired
	private QueryOACarApplyService qryCarApplySer;
	
	@Test
	public void test() {
//		fail("Not yet implemented");
		delCarApp();
	}

	private void delDrugP(){
		String sql = "select * from oa_drug_purchases";
		List<OADrugPurchase> list = qryDrugPurchaseService.getAllList(sql);
		for(OADrugPurchase a:list){
			if(a.getApply_deptname().equals("未在岗人员")){
				System.out.println(a.getName() + ", " + a.getApply_deptname());
				drugPurchaseService.del(a.getId());
			}
		}
	}
	private void delCarApp(){
		String sql = "select * from oa_car_apply";
		List<OACarApply> list = qryCarApplySer.getAllList(sql);
		for(OACarApply a:list){
			if(a.getApply_deptname().equals("全院科室")){
				System.out.println(a.getName() + ", " + a.getApply_deptname());
//				drugPurchaseService.del(a.getId());
			}
		}
	}
}
